<?

$this->firstChild = true;
$this->lastChild = false;

if ($this->_pages)
{
	?><div class="pagination top"><?=$this->_pages;?></div><?
}

$total = sizeof($this->_objects);
?>
<table width="100%" cellspacing="0" cellpadding="0" class="edit_block highlight_table<?php echo $this->_sortable ? ' sortableList' : ''; ?>">
<?php
if ($this->_showHeader)
{
?>
<thead>
	<tr class="active-container first-child<?php echo !$total ? ' last-child' : ''; ?>">
	<?php
		$this->firstChild = false;

		$cellNum = 0;
		foreach ($this->_headers as $cellName => $html)
		{
			$cellNum++;
			if ($cellNum == 1)
			{
				$thClass = 'first';
			}
			else if ($cellNum == $this->_cellCount)
			{
				$thClass = 'last';
			}
			else
			{
				$thClass = '';
			}

			if (isset($this->_cellClasses[$cellName]))
			{
				$thClass .= ' ' .$this->_cellClasses[$cellName];
			}

			?><th class="cell-header-<?php echo $cellName; ?> <?php echo $thClass; ?>"><?php echo false !== $html ? $html : '&nbsp;'; ?></th><?php
		}
	?>
	</tr>
</thead>
<?
}
?>
<tbody>
<?php
$i = 0;
while (list(, $obj) = each($this->_objects))
{
	$i++;
	if ($i == $total)
	{
		$this->lastChild = true;
	}

	echo $this->GetRow($obj);

	$this->firstChild = $this->lastChild = false;
}
?>
</tbody>
</table>
<?
if ($this->_pages)
{
	?><div class="pagination bottom"><?=$this->_pages;?></div><?
}
?>